import React from 'react';
import {Route,Switch, withRouter} from 'react-router-dom';
import './App.css';
// import Video from './components/Video';
// import Duanzi from './components/Duanzi';
// import Goods from './components/Goods';
// import YiYan from './components/YiYan';
// import Website from './components/Website';
// import LOL from './components/LOL';
// import ReactRouterDemo from './components/ReactRouteDemo';
// import Music from './components/Music';
import LOL from './pages/LOL';
import Hero from './pages/Hero';
import VideoList from './pages/VideoList';
import VideoDetail from './pages/VideoDetail';
import Zan from './pages/Zan';

class App extends React.Component {
    render() {
        return <div>
            <Switch>
                <Route path="/lol" component={LOL} />
                <Route path="/hero/:id" component={Hero} />
                <Route path="/videos"  component={VideoList} />
                <Route path="/video" component={VideoDetail} />
                <Route path="/zan" component={Zan} />
            </Switch>
        </div>;
    }

    jumpHero = () => {
        this.props.history.push('/lol');
    }
    
    jumpVideo = () => {
        this.props.history.push('/videos');
    }
}

//将一般组件转化为 路由组件
export default withRouter(App);
